<template>
  <div>
    <!-- 标题部分 -->
    <h1 class="title" v-show="!isShow1">
      标题
      <span class="tag">测试</span>
      <div v-show="isShow2">
        <button @click="btn2" class="edit-btn">编辑</button>
        </div>
    </h1>

    <!-- 编辑内容 -->
    <div v-show="isShow1">
      <div class="input-group">标题：<input type="text" /></div>
      <div class="input-group">
        频道：<select>
          <option value="前端">前端</option>
          <option value="测试">测试</option>
          <option value="Java">Java</option>
        </select>
      </div>
      <div class="operation">
        <button class="cancel"  @click="btn3">取消</button>
        <button class="confirm">确认</button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
   name: "App",
  
  data() {
    return {
      tips2:'前端',
      tips1:'如何成为前端老鸟',
 isShow1: false,
 isShow2: true,
    };
  },
  methods: {
    btn2(){
      this.isShow1 = !this.isShow1,
      this.isShow2 = !this.isShow2
    },
    btn3(){
      this.isShow1 = !this.isShow1,
      this.isShow2 = !this.isShow2
    }
  },
};
</script>

<style>
.title {
  display: flex;
  align-items: center;
}

.tag {
  margin-left: 8px;
  padding: 3px 6px;
  border-radius: 8px;
  background-color: green;
  font-size: 0.6em;
  color: #fff;
}

.edit-btn {
  margin-left: 32px;
  font-size: 0.8em;
  color: lightskyblue;
}

.input-group {
  margin-top: 16px;
  font-size: 28px;
}

.input-group input,
.input-group select {
  width: 300px;
  border-color: #ddd;
  font-size: 28px;
}

.operation {
  margin-top: 16px;
}

.cancel {
  margin-left: 85px;
  background-color: #ddd;
}

.cancel,
.confirm {
  padding: 8px 24px;
  border: 0;
  border-radius: 4px;
}

.confirm {
  margin-left: 16px;
  background-color: #006699;
  color: #fff;
}
</style>
